import { fetchAlbumCategory, fetchAlbumList } from "@/services/apis/media/album";
import { defineStore } from "pinia";

export const useAlbumStore = defineStore("album", {
  state: () => {
    return {
      albumList: [], // 相册列表
      categoryList: [], // 相册分类列表
    }
  },
  actions: {
    async fetchAlbumList(data?: Record<string, any>) {
      const res = await fetchAlbumList(data)
      this.albumList = res.list
      return res.list
    },
    async fetchAlbumCategory(data?: Record<string, any>) {
      const { list} = await fetchAlbumCategory(data)
      this.categoryList = list
      return list
    },
  }
});
